﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;


using System.Web.Mvc;
using Gman.Entity.Entities;
using System.Collections.Generic;

namespace Gman.WebApp.Models
{
    public class ProveedorModel : BaseModel
    {


        public Guid? ID { get; set; }
        public string Action { get; set; }



        public ValidationBase Validator { get; set; }
        public List<KeyValuePair<string, string>> ValidationList = new List<KeyValuePair<string, string>>();
        public List<KeyValuePair<string, bool>> PropertyVisibilityList = new List<KeyValuePair<string, bool>>();

        public ToolBarModel ToolBar { get; set; }
        public List<PersonalModel> Personales { get; set; }


        public SelectList Departamento { get; set; }
        public SelectList Provincia { get; set; }
        public SelectList Distrito { get; set; }

        public List<ProveedorBE> proveedorList { get; private set; }


        public List<PersonalBE> personalList { get; private set; }


        public UbigeoBE Ubigeo { get; set; }

        public ProveedorBE proveedor { get; set; }
        public PersonalBE personal { get; set; }


        //add-edit-delete
        public List<Int32?> toDelete { get; set; }


        public ProveedorModel()
        {
            this.proveedor = new ProveedorBE();
            this.Ubigeo = new UbigeoBE();
            this.ID = Guid.NewGuid();
            Personales = new List<PersonalModel>();
        }

        public ProveedorModel(ProveedorBE bean, UbigeoBE ubigeo)
        {
            proveedor = bean;
            Ubigeo = ubigeo;
            ID = Guid.NewGuid();
            Personales = new List<PersonalModel>();


        }

        public ProveedorModel(ProveedorBE bean, UbigeoBE ubigeo, IList<ProveedorBE> Lista)
        {
            proveedor = bean;
            Ubigeo = ubigeo;
            ID = Guid.NewGuid();
            //
            proveedorList = Lista.ToList();
            Personales = new List<PersonalModel>();
        }


        public ProveedorModel(IList<ProveedorBE> list)
        {
            proveedorList = list.ToList();
            ID = Guid.NewGuid();
            Personales = new List<PersonalModel>();
        }

        //para jaime 
        public ProveedorModel(ProveedorBE bean, UbigeoBE ubigeo, IList<ProveedorBE> Lista, PersonalBE personal)
        {
            this.proveedor = bean;
            this.Ubigeo = ubigeo;
            //
            this.proveedorList = Lista.ToList();
            //this.personalList = Listper.ToList();

            this.personal = personal;
            ID = Guid.NewGuid();

            Personales = new List<PersonalModel>();
            toDelete = new List<Int32?>();
        }



    }


}




